from django.shortcuts import HttpResponse, redirect
from django.utils.deprecation import MiddlewareMixin


class AuthMiddleware(MiddlewareMixin):
    def process_request(self,request):
        if request.path_info == "/la/login/":
            return
        info = request.session.get("info")
        if info:
            return

        return redirect("/la/login/")